You can drop Web Awesome components anywhere on the web and they'll work - no JavaScript framework is necessary.
Friday, March 29, 2024Wix's "Create with AI" button allows users to build entire AI-generated websites by answering a few questions from a chatbot. The process is completed in seconds, and you can edit the design, tweaking the theme and layouts. The website's content benefits from artificial intelligence. Wix offers prompts for creating images and text.
Friday, March 8, 2024TypeScript has become the default language of choice as web development has embraced static typing during the past decade. However, there are times when you don’t want to use TypeScript, whether due to tooling constraints, longer setup and compile time, or a team member who does not like static typing. JSDoc is a good alternative as it can be understood by the TypeScript compiler and lets you take advantage of some of the benefits of static typing without needing a single .ts file. This post serves as a crash course in using JSDoc as an alternative syntax for TypeScript and covers the important TypeScript-related features.
Tuesday, March 5, 2024Developer consoles in web browsers offer more than just text logging. You can use the %c format specifier to insert CSS, SVG, and even limited HTML directly into console.info() or console.log() output. This opens up possibilities for stylized text, animated graphics, and interactive elements right in the console. While there are limitations, like no external images or event listeners, this technique offers a unique way to enhance debugging and add surprises for curious users.
Tailwind CSS v4.0 Alpha is a major update that introduces a faster engine, streamlined configuration, and new features. Built with Rust and Lightning CSS, the new engine significantly improves performance and reduces bundle size. Configuration now happens directly in CSS files using CSS variables, eliminating the need for separate JavaScript config files. Tailwind CSS v4 also comes with built-in support for PostCSS features like @import and nesting, making CSS preprocessing easier.
The primary cause of website complexity and issues is developers overriding default browser functionality.
Meta’s react-strict-dom (open sourced last week) is an experimental integration of React DOM and StyleX that standardizes the development of styled React components, both web and native. This article goes into the historical background of building a universal codebase that shares components between Web and Native and how react-strict-dom changes the way we can do it. You might need to refresh the page to get it to load!
Adopted stylesheets allow for the easy integration of global styles (like utility classes) into Shadow DOM-encapsulated web components, enabling consistent styling within modular application designs.
This blog explores the concept of using `infinity` within CSS, specifically in the `calc()` function, to achieve unique effects like ensuring an element has the highest `z-index`, creating extremely large elements, and dealing with browser inconsistencies. `infinity` is essentially shorthand for the largest possible value in a particular situation. This value can and will change between browsers, operating systems, and CSS properties. It can be used to create some pill shapes, hide content for screen readers, and make CSS animations.
Astro is a static site generator that offers a robust development experience with TypeScript integration and built-in i18n/l10n support. Its static site generation conflicted with this developer's need for server-side locale negotiation, so they integrated a Rust web server (axum) to serve the Astro website, allowing for custom locale negotiation logic while still using Astro's advantages.
Coroutines are functions that can be suspended and resumed while potentially passing data between suspension points. They are useful for implementing various patterns involving cooperation between different tasks or functions, such as asynchronous flows. This article demonstrates how to use coroutines to build a very flexible and simple abstraction for UI components, enabling you to split behavior and view into reusable bits, maintain internal state, and consolidate component lifecycles within a single location.
Streaming HTML sends HTML from server to browser in chunks as it is generated. It took a back seat as single-page applications became the standard, but it has become more popular along with server-side rendering. A clear advantage to streaming HTML is you can render something immediately to indicate to the user that something is happening and you can start downloading assets like CSS and JavaScript earlier while you wait for the more time-consuming parts of the response to be generated.
There is a widespread disregard for front-end development within the tech industry. Frontend work is sometimes biased against as there are beliefs that frontend is less technical and thus, less valued. This devaluing of frontend work harms the quality of software products and limits the potential of the web.
A dead end in a website is where the flow of visitors stops because the page lacks offers, information, or a reason to stay. This article describes 7 common dead ends and how to fix them. These include service pages without clear CTAs, blog posts without relevant internal links, and thank you pages without a clear next step.
The web has seen an increase in complexity, slowing it down significantly for users with low-end devices or slow internet connections. Modern web apps are CPU-hungry. Even with fast internet, websites like Threads and Patreon take a long time to load on low-end phones because of CPU demands. Most developers believe that hardware will get faster and solve performance issues, but hardware improvements slow down over time. Instead, deliberate optimization to reduce CPU impact is crucial in making the web usable for everyone as web bloat locks people from countries with slower internet speeds out.
This is a tutorial on how to identify unoptimized images and how to optimize them to improve your web application’s performance. Developers should use modern formats like AVIF and WebP where possible and size their images properly to match their rendered dimensions. The `picture` element can be used with multiple image formats and resolutions for the browser to automatically select the best fit. Images below the fold should be lazy loaded.
InvertOrNot is a free, open-source API that predicts if an image should be inverted for optimal dark-mode rendering.
Jampack optimizes static websites for the best user experience and Core Web Vitals scores.
Mountaineer is a web framework for building Web applications using Python.
This guide lists all the new additions to CSS, like nesting, container queries, view transitions, and :has(). Each feature comes with an explainer, demo, code example, and a quick bit of detail as to why you should care about them.
This developer inlined their CSS and split it into critical and non-critical sections to optimize their website’s loading speed, leading to a 22% reduction in First Contentful Paint time. Moving minor JavaScript logic into static HTML generation further improved load times slightly. These optimizations ultimately increased page views by 32% over one week.
Frontend debugging is often a time-consuming and frustrating process because developers lack visibility into what's happening on the user's end. Traditional tools provide metrics, but don't always give enough context to identify root causes of issues. A better way to debug frontend issues is to use observability tools that capture more contextual data about how problems occur.
React Resize Aware can detect resize events on elements without relying on intervals, loops, DOM manipulation detection, or CSS redraws.
Concrete.css is a classless CSS stylesheet. It supports dark mode and switches themes depending on system settings.
This blog post dives into how you can use Fastify, Vite, and @fastify/vite to produce a small, low-overhead application setup that has the absolute minimal set of dependencies and moving parts. This setup achieved similar SSR performance but with a fraction of dependencies from Astro, making the overall development setup much smaller. The post first gives a crash course on Vite, then walks through how to integrate it into Fastify applications, before finally moving on to the rewrite.
This blog post shows how to use promises in JavaScript to enable non-blocking async tasks. It breaks down the process from start to finish. Promises can trigger an asynchronous action if a handler is attached by either then or catch. Since the handlers are pushed to the Microtask Queue, you can handle the eventual result in a non-blocking way. This makes it easier to handle errors, chain multiple operations together, and keep your code more readable.
This case study explains the impact of inlining CSS on a website's loading times and traffic.
The solution presented in this article adds a loading progress bar to Next.js sites using a custom ‘useProgress’ hook and a ‘ProgressLink’ component, making page transitions smooth without needing router events. It keeps sites responsive and interactive during loads by utilizing React’s ‘startTransition’. The method is future-proof and improves the user experience.
Optimistic UI is a technique used to improve the perceived performance of web applications by updating the UI instantly in response to user actions, even before getting a response from the server. React's experimental hook useOptimistic() simplifies the implementation of Optimistic UI by providing a way to manage temporary optimistic state alongside the true state. Internally, useOptimistic() leverages React's update mechanism but adds a special revertLane for easy switching between optimistic and true states.
Responsive images in HTML are a way to provide multiple versions of an image, optimized for different screen sizes, resolutions, and layout conditions. The browser will automatically select the most appropriate image source for the current display and layout. To implement responsive images, you can use the srcset and sizes attributes on the `img` element, or use the `picture` and `source` elements for more advanced techniques like art direction. Modern browsers also support features such as lazy loading with sizes=auto.